package com.boruishangge.aplus_app.uitls;

import com.alibaba.android.arouter.launcher.ARouter;
import com.boruishangge.persagysdk.base.AppApplicationContext;
import com.boruishangge.persagysdk.uitls.AppUtils;
import com.jeremyliao.liveeventbus.LiveEventBus;
import com.tencent.mmkv.MMKV;


/**
 *
 * 初始化第三方的 sdk 库 工具类
 * Created by wuaomall@gmail.com on 2019/8/15.
 */
public class SDkInitUitls {
     private static long  myThread=5000;
    private static class SDkInitUitlsv {
        private static final SDkInitUitls instance = new SDkInitUitls();
    }

    private SDkInitUitls() {
    }

    public static SDkInitUitls getInstance() {
        return SDkInitUitlsv.instance;
    }












    /**
     * 初始化ARoute 路由
     */
    public    static  void  initARoute(){
        if (AppUtils.isDebugMode(AppApplicationContext.context)) {           // 这两行必须写在init之前，否则这些配置在init过程中将无效
            ARouter.openLog();     // 打印日志
            ARouter.openDebug();   // 开启调试模式(如果在InstantRun模式下运行，必须开启调试模式！线上版本需要关闭,否则有安全风险)
        }
        ARouter.init(AppApplicationContext.application); // 尽可能早，推荐在Application中初始化
    }




    public  static  void  initLiveBusEvent(){
        LiveEventBus.get()
                .config()
                .supportBroadcast(AppApplicationContext.context)
                .lifecycleObserverAlwaysActive(true)
                .autoClear(false);
    }

    public  static  void  initEasySocketTask(){

    }


    public static  void  initMMKV(){
        String rootDir = MMKV.initialize(AppApplicationContext.application);
        System.out.println("mmkv root: " + rootDir);

    }









}
